<template>
  <view class="container">
    <button type="default" @click="jump('/pages/index/index')">首页</button>
    <button type="default" @click="jump('/pages/other/other')">其他页</button>
    <custom-red-text></custom-red-text>
    <custom-top-charts></custom-top-charts>
    <custom-lang></custom-lang>
    <custom-child-show
    ref="customChildShow"
    >
    </custom-child-show>
  </view>
</template>

<script>
import useStore from "@/store/index";
import CustomRedText from "./components/CustomRedText/CustomRedText.vue";
import CustomTopCharts from "./components/CustomTopCharts/CustomTopCharts.vue";
import CustomLang from "./components/CustomLang/CustomLang.vue";
import CustomChildShow from "./components/CustomChildShow/CustomChildShow.vue";
export default {
  components: { CustomRedText, CustomTopCharts, CustomLang, CustomChildShow },
  data() {
    return {
      scrollTop: 0,
    };
  },
  onLoad() {},
  onShow() {
    // customChildShow
   this.init()
  },
  methods: {
    init() {
      // 执行触发子组件的方法
			this.$nextTick(() => {
        const child = this.$refs.customChildShow;
        if (child && typeof child.init === 'function') {
          child.init();
        }
      });
		},
    jump(url) {
      return this.$jump(url);
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
}
</style>
